#include <iostream>

using namespace std;

int main() {
    int x;
    scanf("%d", &x);
    if (x % 400 == 0)
    {
        cout << 1 << endl;
        return 0;
    }
    if (x % 100 == 0) cout << 0 << endl;
    else if (x % 4 == 0) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}